/**
 * @Description 用户服务
 * @Date 2023/5/19 周五 16:54
 * @Author 酷奇 <vx：17685112557>
 */
import { UserLoginVo } from '@/service/user/vo'
import ResData from '@/utils/resData'
import { UserInfoDto, UserLoginDto } from '@/service/user/dto'
import { GET, POST } from '@/utils/requset'

enum User {
  USER_LOGIN = '/user/login',
  USER_INFO = '/user/info',
}

interface IService {
  /**
   * 用户登录
   * @param p
   */
  login: (p: UserLoginVo) => Promise<ResData<UserLoginDto>>
  /**
   * 用户详情
   */
  info: () => Promise<ResData<UserInfoDto>>
}

const UserService: IService = {
  login: (params) => POST(User.USER_LOGIN, params),
  info: () => GET(User.USER_INFO),
}

export default UserService
